<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>日志查看</title>
    <style>
        body {
            background-color: #f5f5ff; /* 淡紫色背景 */
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
        }

        h1 {
            color: #6a4c9c; /* 深紫色 */
            text-align: center;
            padding: 20px;
            background-color: #dcd0e1; /* 淡紫色背景 */
            margin: 0;
        }

        table {
            width: 90%;
            margin: 30px auto;
            border-collapse: collapse;
            background-color: #fff; /* 白色背景 */
            box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
        }

        th, td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #ddd; /* 淡灰色边框 */
        }

        th {
            background-color: #e8d3f5; /* 浅紫色 */
            color: #6a4c9c; /* 深紫色文字 */
        }

        tr:nth-child(even) {
            background-color: #f9f5fa; /* 每隔行有淡紫色背景 */
        }

        tr:hover {
            background-color: #e1d1f1; /* 鼠标悬停时变为稍深的紫色 */
        }

        td {
            color: #4a4a4a; /* 表格文字颜色 */
        }

        /* 分页按钮样式 */
        .pagination {
            text-align: center;
            margin-top: 20px;
        }

        .pagination a {
            padding: 8px 16px;
            margin: 0 5px;
            background-color: #6a4c9c; /* 深紫色 */
            color: white;
            text-decoration: none;
            border-radius: 4px;
        }

        .pagination a:hover {
            background-color: #5a3b8b; /* 鼠标悬停时变深紫色 */
        }

        .pagination .disabled {
            background-color: #ddd;
            cursor: not-allowed;
        }

        .pagination span {
            font-size: 16px;
            margin: 0 10px;
        }
    </style>
</head>
<body>
<h1>日志内容</h1>

<table>
    <thead>
    <tr>
        <th>日志条目</th>
    </tr>
    </thead>
    <tbody>
    <%
        List<String> logs = (List<String>) request.getAttribute("logs");
        for (String log : logs) {
    %>
    <tr>
        <td><%= log %></td>
    </tr>
    <%
        }
    %>
    </tbody>
</table>

<!-- 分页按钮 -->
<div class="pagination">
    <%
        int currentPage = (int) request.getAttribute("currentPage");
        int totalPages = (int) request.getAttribute("totalPages");
    %>
    <a href="logViewer?page=<%= currentPage - 1 %>" class="<%= currentPage <= 1 ? "disabled" : "" %>">上一页</a>
    <span>第 <%= currentPage %> 页 / 共 <%= totalPages %> 页</span>
    <a href="logViewer?page=<%= currentPage + 1 %>" class="<%= currentPage >= totalPages ? "disabled" : "" %>">下一页</a>
</div>
</body>
</html>